package jw.hospital.controller.api;

import io.swagger.annotations.ApiOperation;
import jw.hospital.common.result.ResultResponse;
import jw.hospital.hosp.model.hospital.Hospital;
import jw.hospital.hosp.vo.HospitalQueryVo;
import jw.hospital.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/*
 *@Author Mark Lee
 *@Date 2021/9/7 11:19
 */

@RestController
@RequestMapping(value ="/admin/hosp/hospital")
public class HospitalController {

    @Autowired
    private HospitalService  hospitalService;

    @ApiOperation(value = "分页查询医院信息")
    @RequestMapping(value = "/list/{page}/{limit}")
    public ResultResponse  list(@PathVariable("page") Integer page,
                                @PathVariable("limit")Integer limit,
                                @RequestParam(required = false) HospitalQueryVo hospitalQueryVo){
       Page<Hospital> pageModel = hospitalService.getHospitalPage(page,limit,hospitalQueryVo);
       return  ResultResponse.ok(pageModel);
    }




}
